﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gendan_auto.aspx.cs" Inherits="gendan_auto" Title="自动跟单" MasterPageFile="APP_Master/MasterPage_Default.master" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <link href="App_Themes/css/webstyle.css" rel="stylesheet" type="text/css" />
    <%--    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>--%>
    <script src="App_Themes/js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="App_Themes/js/jquery.jBox-2.3.min.js" type="text/javascript"></script>
    <script src="App_Themes/js/jquery.jBox-zh-CN.js" type="text/javascript"></script>
    <script src="App_Themes/js/jquery.fxTab.js" type="text/javascript"></script>

    <link href="App_Themes/css/Blue/jbox.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.fancybox.pack.js"></script>
    <link href="js/jquery.fancybox.css" rel="stylesheet" />
    <script type="text/javascript">

        function login() {

            $("#box11 .011").trigger('click');
        }

        function tck(parameters) {
            alert("已满");
        }

        function GetLoginInfo(userid) {
        }
        function gendanMade(id, LotteryType, LotteryOpenTime, UserID) {
            $.ajax({
                type: "get",
                dataType: "text",
                url: "Ajax/CMember.ashx?",
                data: { t: 'GetLoginInfo' },
                success: function (data) {
                    if (data.indexOf('请登录') != -1) {
                        login();
                        return false;
                    } else {

                        if (data == UserID) {
                            alert("发起人不可以重复定制!");
                            return;
                        }
                        else {
                            $.ajax({
                                type: "get",
                                dataType: "json",
                                url: "Ajax/CMember.ashx?",
                                data: { t: 'LotteryQS', id: id, LotteryType: LotteryType, LotteryOpenTime: LotteryOpenTime },
                                success: function (data) {
                                    var obj = eval(data);
                                    var qs = obj.qs;
                                    var pre_opentime1 = obj.opentime.split(" ");
                                    var pre_date = pre_opentime1[0];
                                    var pre_time = pre_opentime1[1];
                                    var time = new Date();
                                    var month = time.getMonth() + 1;
                                    var ss = time.getSeconds();
                                    if (ss < 10) {
                                        ss = "0" + ss;
                                    }
                                    var mm = time.getMinutes();
                                    if (mm < 10) {
                                        mm = "0" + mm;
                                    }
                                    //var current_date = time.getFullYear() + "/" + month + "/" + time.getDate() + " " + time.getHours() + ":" + mm + ":" + ss;
                                    var current_date = time.getFullYear() + "/" + month + "/" + time.getDate();
                                    var current_time = time.getHours() + ":" + mm + ":" + ss;
                                    if (qs != LotteryOpenTime)
                                    {
                                        $.ajax({
                                                type: "get", dataType: "json", url: "Ajax/CMember.ashx?", data: { t: 'Zhuangtai', id: id }, success: function (data) {
                                                    alert("定制已失效!");
                                                    location.href = location.href;  //定制失效时，刷新当前页面
                                                }
                                            });                                         
                                    }
                                    else
                                    {
                                        if (pre_date < current_date) {
                                            $.ajax({
                                                type: "get", dataType: "json", url: "Ajax/CMember.ashx?", data: { t: 'Zhuangtai', id: id }, success: function (data) {
                                                    alert("定制已失效!");
                                                    location.href = location.href;  //定制失效时，刷新当前页面
                                                }
                                            });                                         
                                        }
                                        else {
                                            if (pre_time <= current_time) {
                                                $.ajax({
                                                    type: "get", dataType: "json", url: "Ajax/CMember.ashx?", data: { t: 'Zhuangtai', id: id }, success: function (data) {
                                                        alert("定制已失效!");
                                                        location.href = location.href;  //定制失效时，刷新当前页面
                                                    }
                                                });
                                            }
                                            else {
                                                var type = LotteryType == 1 ? "双色球"
                                               : (LotteryType == 2 ? "大乐透"
                                                   : (LotteryType == 3 ? "排列三"
                                                       : (LotteryType == 4 ? "排列五"
                                                           : (LotteryType == 5 ? "福彩3D"
                                                               : LotteryType == 6 ? "七星彩"
                                                               : (LotteryType == 7 ? "七乐彩" : "")))));
                                                $.jBox("iframe:/gendan_made.aspx?id=" + id, {
                                                    title: type + " " + "跟单定制",
                                                    width: 520,
                                                    height: 715,
                                                    top: 100,
                                                    buttons: {}
                                                });
                                            }
                                        }
                                    }
                                }
                            });


                        }
                    }
                },
                error: function () {
                }

            });

        }
        function lotterychakan(id, UserID, LotteryType) {

            $.jBox("iframe:/gendan_chakan.aspx?id=" + id + "&UserID=" + UserID + "&LotteryType=" + LotteryType, {
                title: "查看",
                width: 900,
                height: 650,
                top: 200,
                buttons: {}
            });
        }
    </script>
    <style type="text/css">
        .auto-style1 {
            height: 15px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <div class="nr">
        <div class="zdgd_k">
            <div class="zdgd_top">
                 <!-- <span class="fl">彩种：</span>
                <asp:DropDownList ID="qsddl" runat="server" class="zdgd_bd1" OnSelectedIndexChanged="qsddl_SelectedIndexChanged" AutoPostBack="True">
                </asp:DropDownList>-->
                <%--<asp:DropDownList ID="qsddl" runat="server" class="zdgd_bd1" OnSelectedIndexChanged="qsddl_SelectedIndexChanged"></asp:DropDownList>--%>
                <span class="fl">筛选：</span>
                <asp:DropDownList ID="isManDDl" runat="server" AutoPostBack="true"
                    class="zdgd_bd2"
                    OnSelectedIndexChanged="isManDDl_SelectedIndexChanged">
                    <asp:ListItem Value="0">--全部--</asp:ListItem>
                    <asp:ListItem Value="1">--未满员--</asp:ListItem>
                    <asp:ListItem Value="2">--50%-90%--</asp:ListItem>
                    <asp:ListItem Value="3">--90%以上--</asp:ListItem>
                </asp:DropDownList>
                <span class="fl">按用户名查找：</span>
                <asp:TextBox ID="UserName" runat="server" class="zdgd_bd3"></asp:TextBox>
                <asp:Button ID="gendan_search" runat="server" Text="搜索" class="zdgd_bd4" OnClick="gendan_search_Click" />
                <%--<a href="login.aspx" class="01"  class="dz_t_text fr">我的彩票</a>--%>
                <%--    <a href="personal.aspx" class="dz_t_text fr">我的彩票</a>--%>
                <%--      <a href="personal.aspx" class="dz_t_text fr">查看跟进记录</a>--%>
                <div class="cl"></div>
            </div>
            <style type="text/css">
                .fxui-tab {
                }

                .fxui-tab-hand {
                    line-height: 24px;
                    padding: 0 25px 20px 25px;
                    border-bottom: solid 2px #f7fbfe;
                }

                .fxui-tab-tit {
                    display: block;
                    float: left;
                    padding: 0 10px;
                    color: #464646;
                    font-size: 14px;
                    height: 23px;
                    margin: 0 0 0 15px;
                    cursor: pointer;
                }

                .fxui-tab-hand .curr {
                    border-bottom: solid 2px #ff0000;
                }

                .fxui-tab-nav {
                }
            </style>
            <div class="zdgd_bg1">
                <div class="fxui-tab">
                    <div class="fxui-tab-hand">
                        <span class="zdgd_text1 fl">跟单红人</span>
                        <span class="fxui-tab-tit">当前红人</span>
                        <span class="fxui-tab-tit">中大奖</span> <%--<span class="fxui-tab-tit">高回报</span><span class="fxui-tab-tit">竞技彩高手</span><span class="fxui-tab-tit">高度活跃</span>--%>

                        <div class="cl"></div>
                    </div>
                    <div class="fxui-tab-nav">
                        <ul class="zdgd_hr_list">

                            <%if (FellowUpRedDt != null)
                                {
                                    for (int i = 0; i < FellowUpRedDt.Rows.Count; i++)
                                    { %>
                            <li>
                                <div class="zdgd_hr_text1">
                                    <span class="zdgd_hr_text2"><%=FellowUpRedDt.Rows[i]["nickname"] %></span>
                                    <%=ViewModelLevel(Convert.ToInt64(FellowUpRedDt.Rows[i]["UserID"].ToString())) %>

                                    <span style="padding: 0 0 0 10px;"><%=FellowUpRedDt.Rows[i]["GenDanCount"] %>人已定制</span>
                                </div>
                                <div>
                                    <span class="fl">
                                        <img src="<%=FellowUpRedDt.Rows[i]["photo"]== DBNull.Value?"images/w8.jpg" : FellowUpRedDt.Rows[i]["photo"] %>" height="89" width="89" />
                                    </span>
                                    <div class="zdgd_hr_r">
                                        累计中奖：<span class="dz_text"><%=FellowUpRedDt.Rows[i]["winTotal"] %></span>元<br>
                                        擅长彩种：<%=(Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) == "1" ? "双色球"
                                : ((Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) == "2" ? "大乐透"
                                          : ((Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) == "3" ? "排列三"
                                                    : ((Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) == "4" ? "排列五"
                                                              : ((Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) == "5" ? "福彩3D"
                                                                        : (Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) =="6" ? "七星彩"
                                                                                  : ((Convert.ToString(FellowUpRedDt.Rows[i]["LotteryType"].ToString())) == "7" ? "七乐彩" : ""))))) %><br>
                                        定制人数：<%--2000 --%> <span class="dz_text"><%=FellowUpRedDt.Rows[i]["GenDanCount"] %></span>

                                        <div class="zdgd_hr_my">

                                            <%=Convert.ToBoolean(FellowUpRedDt.Rows[i]["State"].ToString())== true ?"<a  onclick='tck()'>已满</a>": Convert.ToBoolean(FellowUpRedDt.Rows[i]["State"].ToString())==false? "<a onclick='javascript:gendanMade(" +FellowUpRedDt.Rows[i]["LotteryChippedID"] + ","+FellowUpRedDt.Rows[i]["LotteryType"]+","+FellowUpRedDt.Rows[i]["LotteryOpenTime"]+");'>"+ "未满</a>":""%>
                                        </div>
                                    </div>
                                    <div class="cl"></div>
                                </div>
                            </li>
                            <%}
                                } %>

                            <div class="cl"></div>

                        </ul>
                    </div>
                    <div class="fxui-tab-nav">
                        <ul class="zdgd_hr_list">
                            <%if (Winning != null)
                                {
                                    for (int i = 0; i < Winning.Rows.Count; i++)
                                    { %>
                            <li>
                                <div class="zdgd_hr_text1">
                                    <span class="zdgd_hr_text2"><%=Winning.Rows[i]["nickname"] %></span>
                                    <%=ViewModelLevel(Convert.ToInt64(Winning.Rows[i]["UserID"].ToString())) %>
                          已中奖<span style="padding: 0 0 0 10px;"></span><span class="dz_text"><%=Convert.ToDecimal(Winning.Rows[i]["winTotal"])/10000%></span>万<br>
                                </div>
                                <div>
                                    <span class="fl">
                                        <img src="<%=Winning.Rows[i]["photo"]== DBNull.Value?"images/w8.jpg" : Winning.Rows[i]["photo"] %>" height="89" width="89" />
                                    </span>
                                    <div class="zdgd_hr_r">
                                        累计中奖：<span class="dz_text"><%=Winning.Rows[i]["winTotal"] %></span>元<br>
                                        擅长彩种：<%=(Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) == "1" ? "双色球"
                                : ((Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) == "2" ? "大乐透"
                                          : ((Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) == "3" ? "排列三"
                                                    : ((Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) == "4" ? "排列五"
                                                              : ((Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) == "5" ? "福彩3D"
                                                                        : (Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) =="6" ? "七星彩"
                                                                                  : ((Convert.ToString(Winning.Rows[i]["LotteryType"].ToString())) == "7" ? "七乐彩" : ""))))) %><br>
                                        定制人数：<span class="dz_text"><%=Winning.Rows[i]["GenDanCount"] %></span>
                                        <div class="zdgd_hr_my">

                                            <%=Convert.ToBoolean(Winning.Rows[i]["State"].ToString())== true ?"<a onclick='tck()'>已满</a>": Convert.ToBoolean(Winning.Rows[i]["State"].ToString())==false? "<a onclick='javascript:gendanMade(" +Winning.Rows[i]["LotteryChippedID"] + ","+Winning.Rows[i]["LotteryType"]+","+Winning.Rows[i]["LotteryOpenTime"]+");'>"+ "未满</a>":""%>
                                        </div>
                                        <div class="cl"></div>
                            </li>
                            <%}
                                } %>
                        </ul>
                        <div class="cl"></div>

                    </div>
                    <%--    <div class="fxui-tab-nav">1111</div>
        <div class="fxui-tab-nav">内容四</div>
        <div class="fxui-tab-nav">内容五</div>--%>
                </div>
            </div>
            <script type="text/javascript">
                $('.fxui-tab').fxuiTab();
            </script>

            <table width="1168" border="0" cellspacing="0" cellpadding="0" class="zdgd_table">
                <tr class="fb">
                    <td width="94" align="center" valign="middle" class="auto-style1">序号</td>
                    <td width="150" align="center" valign="middle" class="auto-style1">超级发起人</td>
                    <td width="194" align="center" valign="middle" class="auto-style1">战绩</td>
                    <td width="188" align="center" valign="middle" class="auto-style1">彩种</td>
                    <td width="188" align="center" valign="middle" class="auto-style1">期数</td>
                    <td width="188" align="center" valign="middle" class="auto-style1">剩余金额</td>
                    <td width="150" align="center" valign="middle" class="auto-style1">已指定/可指定</td>
                    <td width="151" align="center" valign="middle" class="auto-style1">已定制/可定制</td>
                    <td width="123" align="center" valign="middle" class="auto-style1">所有跟单人</td>
                    <td width="118" align="center" valign="middle" class="auto-style1">参与</td>
                </tr>
                <%if (allScheme != null)
                    {
                        for (int i = 0; i < allScheme.Count; i++)
                        {%>
                <tr>

                    <td align="center" valign="middle"><span class="zdgd_table_text1"><%=i+1%></span></td>
                    <td align="center" valign="middle"><span><%=SelectName(allScheme[i].UserID)%></span></td>
                    <td align="center" valign="middle"><span class="zdgd_table_icon">
                        <%=ViewModelLevel(allScheme[i].UserID) %>
                    </span></td>
                    <td align="center" valign="middle"><%=allScheme[i].LotteryType == 1 ? "双色球"
                                                                :(allScheme[i].LotteryType==2 ?"大乐透"
                                                                :(allScheme[i].LotteryType==3?"排列三"
                                                                :(allScheme[i].LotteryType==4 ?"排列五"
                                                                :(allScheme[i].LotteryType==5?"福彩3D"
                                                                :(allScheme[i].LotteryType==6 ?"七星彩"
                                                                :(allScheme[i].LotteryType==4?"七乐彩":""))))))%></td>
                    <td align="center" valign="middle"><% =allScheme[i].LotteryOpenTime %></td>
                    <td align="center" valign="middle"><% =allScheme[i].LotteryYE %></td>
                    <td align="center" valign="middle"><% =dzrs_count(allScheme[i].id)%>/ 25</td>

                    <td align="center" valign="middle"><%=chakan_count(allScheme[i].id) %>/1000</td>

                    <td align="center" valign="middle"><a href="javascript:void(0);" onclick="return lotterychakan(<%=allScheme[i].id %>,<%=allScheme[i].UserID%>,<%=allScheme[i].LotteryType %>)" class="lan">查看</a></td>
                    <% 

                        if (allScheme[i].State)
                        { %>
                    <td align="center" valign="middle">定制已满
                       
                    </td>

                    <%}
                        else
                        {%>
                    <td align="center" valign="middle">
                        <img src="images/w9.jpg" onclick="gendanMade(<%=allScheme[i].id %>,<%=allScheme[i].LotteryType %>,<%=allScheme[i].LotteryOpenTime %>,<%=allScheme[i].UserID %>)" class="auto-style2" id="<%=allScheme[i].id %>">
                    </td>
                    <% }%>
                </tr>
                <%}
                    } %>
            </table>
            <div class="zdgd_page">
                <webdiyer:AspNetPager SubmitButtonClass="buttons" ID="AspNetPager1"
                    runat="server" AlwaysShow="True" FirstPageText="首页"
                    NextPageText="下一页" PrevPageText="前一页" LastPageText="尾页" PageSize="10"
                    OnPageChanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>
            </div>
            <div class="zdgd_gz">
                <span class="zdgd_gz_text">定制跟单规则 <a href="#">[更多]</a></span><br>
                a.跟单用户每个方案最低认购1元，10万元封顶。<br>
                b.跟单用户可自行设置跟单次数，最少1次，最多100次，成功跟单1个方案即算1次。<br>
                c.用户跟单时只定制发起人当前期发起的一个方案。<br>
                d.跟单用户要是碰上心仪的合买发单人要尽早定制，晚了可能就无法跟单成功了。<br>
                e.若方案可购金额少于您设定的定制跟单金额时，则方案剩余多少金额，跟多少金额。<br>
                f.当使用百分比跟单时换算后认购金额大于用户所设置每次认购上限则跟认购金额。<br>
                g.实时扣款即用户不用预付定制跟单金额，只需账户余额满足每次认购金额即可成功定制。<br>
                <%--       h.为了您的账户安全，实时扣款中当累积跟单金额达到用户设置定制总额上限时系统会取消跟单。--%>
            </div>
        </div>
    </div>
    </span>
</asp:Content>
